Implemented the Disable state on swap button for max#174
Merged
AlAfiz merged 1 commit intoBETAIL-BOYS:mainfrom Mar 30, 2026
Merged
Implemented the Disable state on swap button for max#174AlAfiz merged 1 commit intoBETAIL-BOYS:mainfrom
AlAfiz merged 1 commit intoBETAIL-BOYS:mainfrom
Conversation
|
@KAMALDEEN333 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented the disabled state on Swap button for Max Slippage errors
Description
We previously created a modal for high slippage, but we also need visual feedback directly on the main button.
If the calculated slippage exceeds the user's hard maximum (e.g., > 50%), we shouldn't even let them click the button to see the modal.
The main CTA (Call to Action) button should turn gray, disable clicks, and change its text to explain the error.
This provides instant, localized feedback without requiring extra user clicks.
Requirements
Read the current estimated slippage and the user's max slippage setting.
If estimatedSlippage > maxSlippage, set the disabled prop on the component to true.
Change the button text from "Swap" to "Slippage Tolerance Exceeded".
Override the button's background color to a dull gray (bg-slate-700) and remove hover effects.
closes #84
Built a "Slippage Warning" Toast notification for auto-adjusted settings
Description
We previously built an "Auto Slippage" feature that dynamically adjusts the user's tolerance based on market conditions.
However, if the Auto mode shifts the slippage to a dangerously high number (e.g., > 3%) due to extreme volatility, the user might not notice.
We need to trigger a warning Toast notification whenever the Auto slippage calculates a value higher than 2.5%.
This ensures the user is actively informed that their trade is currently at high risk of being front-run.
Requirements
In the main Swap component, monitor the dynamically calculated autoSlippage state.
If autoSlippage exceeds 2.5%, use the global notification system to trigger a yellow warning toast.
The toast message should read: "Warning: Auto-slippage is currently high due to market volatility."
Ensure the toast only fires once per state change to prevent spamming the user's screen.
closes #104